class ApplicationController < ActionController::Base
  protect_from_forgery
  
  before_filter :authenticate_usuario!

	#
	#
	def info(text)
		logger.info "#{params[:controller]}##{params[:action]}: #{text}"
	end

	#
	#
	def debug(text)
		logger.debug "#{params[:controller]}##{params[:action]}: #{text}"
	end

	#
	#
	def error(text)
		logger.error "#{params[:controller]}##{params[:action]}: #{text}"
	end

	#
	#
	def empty?(val)
		return true if val.nil? or val.to_s.strip.empty?
	end

	#
	#
	def belongs_to_current_usuario?(object)
		return false unless object.respond_to?(:usuario)
		
		return object.send(:usuario) == current_usuario
	end
end
